/*
 * @Author: lmk
 * @Date: 2022-04-14 14:27:07
 * @LastEditTime: 2022-04-27 20:56:57
 * @LastEditors: lmk
 * @Description: 
 */
import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '@/pages/Home' //首页
import Activity from '@/pages/Activity' // 活动
import ActivityDetail from '@/pages/Activity/detail' //新闻详情
import News from '@/pages/News' //新闻
import NewsDetail from '@/pages/News/detail' //新闻详情
import About from '@/pages/About' //关于我们
import Around from '@/pages/Around' //文创周边
import MemberDetail from '@/pages/MemberDetail' //文创周边

/* Layout */
import Layout from '@/layout'

const routes = [
  {
    path: '/', 
    component: Layout,
    redirect: '/home',
    children: [{
      path: '/home',
      component: Home,
    },{
      path: '/activity',
      component: Activity
    },{
      path: '/news',
      component: News
    },{
      path: '/about',
      component: About
    },{
      path: '/around',
      component: Around
    },{
      path: '/news/:id',
      component: NewsDetail
    },{
      path: '/activityDetail/:id',
      component: ActivityDetail
    },{
      path: '/memberDetail/:id',
      component: MemberDetail
    }]
  }
]
const router = createRouter({
  history: createWebHashHistory(),
  scrollBehavior: () => ({ y: 0 }),
  routes,
})
export default router
